/**
 * 版权所有 2009-2015 中国中医科学院中医药信息研究所 何前锋 frontpeak@yahoo.com.cn
 **/
package cn.ac.cintcm.sh.domain;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;

public class Chapters {
 
 
	private HashMap<Integer, Chapter> chapters;
    private List<Article> articles;

    public Chapters() {
        chapters = new HashMap<Integer, Chapter>();
        this.articles = new ArrayList<Article>();
    }

    public Collection<Chapter> getChapters() {
        return chapters.values();
    }

    public Collection<Article> getArticles() {
        return articles;
    }

    public void setChapters(HashMap<Integer, Chapter> chapters) {
       this.chapters = chapters;
       for (Chapter c : chapters.values()) {
           articles.addAll(c.getArticles());
       }
    }
	 
}